#! /bin/sh
#### shell for  sugazmig, sumigps
#### Author: John Stockwell 7 Apr 1993
WIDTH=420
HEIGHT=300
XOFF1=0
XOFF2=430
XOFF3=860
YOFF1=5
YOFF2=335
YOFF3=665

perc=99

#### Example 1 --- compute and display impulse response
### use suspike to make test data
n1=64
n2=32
suspike nspk=3 it1=16 ix1=16 it2=32 ix2=16 it3=48 ix3=16 |
sushw key=dt,d2 a=50000,.05 >syndata1
suximage <syndata1 perc=$perc \
	title="Suspike data"\
	label1="Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF1} ybox=${YOFF1} &

### Migrate with SUGAZMIG
sugazmig <syndata1 tmig=0 vmig=1 |
suximage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF2} ybox=${YOFF1} &

### Migrate with SUMIGPS
sumigps <syndata1 tmig=0 vmig=1 |
suximage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF3} ybox=${YOFF1} &

###Example 2 ---- constant velocity migration of simple syncline model
n1=101
n2=101
### use susynlv to make synthetic data
susynlv nt=$n1 dt=0.04 ft=0.0 nxo=1 \
	nxm=$n2 dxm=.05 fxm=0.0 er=0 ob=1  \
	v00=1.0 dvdz=0 dvdx=0 smooth=1 \
	ref="0,.5;1.0,.5;2.,1.0;2.5,1.5;3.0,1.0;4.0,.5;5.0,.5" |
sushw key=d2 a=.05 >syndata2
suximage <syndata2 perc=$perc \
	title="Synthetic Data"\
	label1="Time (sec)" label2="Distance (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF1} ybox=${YOFF2} &

###  Migrate with SUGAZMIG
sugazmig <syndata2 tmig=0 vmig=1 |
suximage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF2} ybox=${YOFF2} &

###  Migrate with SUMIGPS
sumigps <syndata2 tmig=0 vmig=1 |
suximage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF3} ybox=${YOFF2} &

### Example 3 ---- variable velocity migration
n1=101
n2=101
### use susynlv to make synthetic data
susynlv nt=$n1 dt=0.04 ft=0.0 nxo=1 \
	nxm=$n2 dxm=.05 fxm=0.0 er=0 ob=1  \
	v00=1.0 dvdz=.2 dvdx=0 smooth=1 \
	ref="0,.5;1.0,.5;2.,1.0;2.5,1.5;3.0,1.0;4.0,.5;5.0,.5" |
sushw key=d2 a=.05 >syndata3
suximage <syndata3 perc=$perc \
	title="Synthetic Data"\
	label1="Time (sec)" label2="Distance (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF1} ybox=${YOFF3} &

### Migrate with SUGAZMIG --- background velocity specified by tmig and vmig
sugazmig <syndata3 tmig=0,4 vmig=1,2.0 |
suximage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF2} ybox=${YOFF3} &

### Migrate with SUMIGPS --- background velocity specified by tmig and vmig
sumigps <syndata3 tmig=0,4 vmig=1,2.0 |
suximage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF3} ybox=${YOFF3} &

exit 0
